package com.example.provider;

import android.database.sqlite.SQLiteDatabase;

public class TblSong {
	// tables name
	public static final String TABLE_NAME = "song";
	public static final String PLAYLIST_TABLE_NAME = "playlist";

	// Common column names
	public static final String ID = "_id";

	// SONG Table- columns name
	public static final String SONG_ID = "song_id";
	public static final String SONG_GENRE = "genre";
	public static final String SONG_ISFAVORITE = "isFavorite";

	private static String createData() {
		StringBuilder sBuiler = new StringBuilder();
		sBuiler.append("create table " + TABLE_NAME + " (");
		sBuiler.append(ID + " integer primary key autoincrement, ");
		sBuiler.append(SONG_ID + " integer, ");
		sBuiler.append(SONG_GENRE + " text, ");
		sBuiler.append(SONG_ISFAVORITE + " text);");
		return sBuiler.toString();
	}

	public static void onCreate(SQLiteDatabase database) {
		database.execSQL(createData());
	}

	public static void onUpgrade(SQLiteDatabase database, int oldVersion,
			int newVersion) {
		database.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
		onCreate(database);
	}
}
